/*	$Id$	*/
/*
 * cnp_fnv - Fowler/Noll/Vo- hash code
 *
 * @(#) Revision: 1.5 $
 * @(#) Id: cnp_fnv.h,v 1.5 2003/10/03 20:35:52 chongo Exp $
 * @(#) Source: /usr/local/src/cmd/fnv/RCS/fnv.h,v $
 *
 * Please do not copyright this code.  This code is in the public domain.
 *
 * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
 * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 *
 * By:
 *	chongo <Landon Curt Noll> /\oo/\
 *      http://www.isthe.com/chongo/
 *
 * Share and Enjoy!	:-)
 */

#ifndef _CANOPY_FNV_H_
#define _CANOPY_FNV_H_

#include <stdint.h>

/*
 * 32 bit FNV-1 and FNV-1a non-zero initial basis
 *
 * The FNV-1 initial basis is the FNV-0 hash of the following 32 octets:
 *
 *              chongo <Landon Curt Noll> /\../\
 *
 * NOTE: The \'s above are not back-slashing escape characters.
 * They are literal ASCII  backslash 0x5c characters.
 *
 * NOTE: The FNV-1a initial basis is the same value as FNV-1 by definition.
 */
#define FNV1_32_INIT ((uint32_t)0x811c9dc5)
#define FNV1_32A_INIT FNV1_32_INIT

#define FNV1_64_INIT ((uint64_t)0xcbf29ce484222325ULL)
#define FNV1_64A_INIT FNV1_64_INIT


/*
 * external functions
 */
uint32_t cnp_fnv32_hash  (const void *, size_t, uint32_t);
uint64_t cnp_fnv64_hash  (const void *, size_t, uint64_t);
uint32_t cnp_fnv32a_hash (const void *, size_t, uint32_t);
uint64_t cnp_fnv64a_hash (const void *, size_t, uint64_t);


#endif /* _CANOPY_FNV_H_ */
